{% extends "index.html" %}

{% block css-javascript-agregados %}
{% endblock %}

{% block content %}
  {% if query %}
            <h4>Resultados de Búsqueda</h4>
            {% for result in page.object_list %}
                <p>
                	{% if result.object.username %}
                    	<a href="/users/{{ result.object.id }}">{{ result.object.get_full_name }} </a>
                    {% else %}
                    	<a href="{{ result.object.get_absolute_url }}">{{ result.object }}</a>
                    {% endif %}
                </p>
            {% empty %}

                <p>No se encontraron resultados.</p>
            {% endfor %}

            {% if page.has_previous or page.has_next %}
                <div>
                    {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
                    |
                    {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
                </div>
            {% endif %}
        {% else %}
            {# Show some example queries to run, maybe query syntax, something else? #}
        {% endif %}

{% endblock %}
